﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vanfa.Entities
{
    /// <summary>
    /// 设置类或者成员属性是否需要验证
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
    public class DataValidateAttribute : Attribute
    {
        /// <summary>
        /// 获取或者设置是否需要验证
        /// </summary>
        public bool IsValidate { get; set; }
        /// <summary>
        /// 验证方式
        /// </summary>
        public DataValidateWay Method { get; set; }
        /// <summary>
        /// 正则表达式(如果验证方式选择正则表达式)
        /// </summary>
        public string RegExp { get; set; }
        /// <summary>
        /// 反射方法名
        /// </summary>
        public string RefMethodName { get; set; }
    }
}
